package main

import (
	"github.com/gin-gonic/gin"
	"net/http"
)

func main() {
	router := gin.Default()
	router.GET("/jsonp", func(context *gin.Context) {
		data := map[string]interface{}{
			"name": "xiaoming",
		}
		//获取callback参数将其拼到返回体中jsonp({"name":"xiaoming"});
		context.JSONP(http.StatusOK, data)
	})

	router.Run()

}
